﻿<!DOCTYPE html>

<!--培训档案-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>

    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
    </style>
</head>

<body>

    <div id="app" v-cloak>
        <!-- <el-container style="height:100%"> -->
        <!-- <el-header style="height:auto"> -->
        <el-form label-position=" right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                 style="margin-bottom: 15px;">
            <el-row>
                <el-col class="head-tool">

                    <div class="new_title fl"><strong><img src="/static/images/icon1.png" />培训档案列表</strong></div>
                    <span>
                        <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3" @click="onSubmit">
                        </btn>
                        <btn-export-list url="xxxx" :forminline="this.formInline" linetype="3"></btn-export-list>
                        <btn :text="col.btnDelete" linetype="4" @click="onDelete"></btn>
                    </span>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.EmployeeName"
                                      :placeholder="TrainingAchievements.EmployeeName" size="mini">
                                <template slot="prepend">
                                    {{TrainingAchievements.EmployeeName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{TrainingAchievements.Department+mark.m}}
                                </template>
                                <treeselect v-model="formInline.model.Department"
                                            :options="department"
                                            :flat="true"
                                            :show-count="true"
                                            slot="suffix"
                                            style="line-height: 28px;"
                                            placeholder="请选择" />
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainingtime+'开始'+mark.m}}
                                </template>
                                <!-- <el-date-picker v-model="formInline.model.DiscoveryTimeBegin" type="date" slot="suffix" -->
                                <el-date-picker v-model="formInline.model.TrainingtimeStar" type="date" slot="suffix"
                                                size="mini" placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{TrainingPlanManagement.Trainingtime+'结束'+mark.m}}
                                </template>
                                <!-- <el-date-picker v-model="formInline.model.DiscoveryTimeEnd" type="date" slot="suffix" -->
                                <el-date-picker v-model="formInline.model.TrainingtimeEnd" type="date" slot="suffix"
                                                size="mini" placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

            </el-row>

        </el-form>
        <!-- </el-header> -->
        <!-- <el-main style="padding-top:0;"> -->
        <!-- <el-row> -->

        <el-col span="24">


            <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys" :height="ListItem.tableHeight"
                      border @selection-change="handleSelectionChange" row-style="height:10px"
                      style="width: 100%;height: 100%;">
                <el-table-column type="selection" style="
        padding-top: 0px;
        padding-bottom: 0px;
    " align="center" width="55" :reserve-selection="true">
                </el-table-column>

                <!-- 除第一列以外 遍历所有字段 -->
                <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  下同-->
                <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                                 show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="name" :label="TrainingAchievements.EmployeeName">
                </el-table-column>
                <el-table-column prop="joinDate" :label="TrainingAchievements.StartingDate">
                </el-table-column>
                <el-table-column prop="departmentName" :label="TrainingAchievements.Department">
                </el-table-column>
                <el-table-column prop="dutyName" :label="TrainingAchievements.Position">
                </el-table-column>
                <el-table-column prop="Numberoftrainingsessionsduringthistimeperiod"
                                 :label="TrainingAchievements.Numberoftrainingsessionsduringthistimeperiod" width="140">
                </el-table-column>




                <el-table-column width="53" :label="col.btndetails" fixed="right">
                    <template slot-scope="scope">
                        <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                            <i class="el-icon-tickets"></i>
                        </button>
                    </template>
                </el-table-column>

            </el-table>
            <el-row type="flex" justify="end">
                <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                               :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                               :layout="ListItem.layout" :total="ListItem.total">
                </el-pagination>

            </el-row>
            <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  -->


        </el-col>

        <!-- </el-row> -->
        <!-- </el-main> -->
        <!-- <el-footer style="height: 28px;"> -->
        <el-dialog title="培训档案" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%"
                   top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:100%;width:100%" frameborder="0"></iframe>
        </el-dialog>
        <!-- </el-footer> -->
        <!-- </el-container> -->
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        var app = new Vue({
            el: '#app',
            data: {
                ListItem: ListItem,
                value1: '',

                department: [],
                isShow: true,
                formInline: {
                    value1: '',
                    // 遍历所有列 均为字符串即可
                    model: {
                        id: null,
                        EmployeeName: '',
                        StartingDate: '',
                        Department: null,
                        Position: '',
                        Numberoftrainingsessionsduringthistimeperiod: '',
                        name: '',
                        Gender: '',
                        BirthDate: '',
                        Education: '',
                        Workinghours: '',
                        jobtime: '',
                        GraduateSchool: '',
                        GraduateSchool2: '',
                        WorkingDepartment: '',
                        Jobs: '',
                        Whatyearandmonthvalueandannualcontract: '',
                        Whichdepartmentisinwhichposition: '',
                        Anyposition: '',
                        Remarks: '',
                        Trainingtime: '',
                        TrainingObjectives: '',
                        TouristLocation: '',
                        TrainingObjectives2: '',
                        TrainingType: '',
                        TrainingContent: '',
                        PlannedUnplanned: '',
                        Score: '',
                        EmployeeSignature: ''

                    },
                    offset: 0,
                    limit: 10
                }
            },
            mounted: function () {
                this.getDepartmentData();
                //console.log(getDicDataArray(["01", "02", "03", "04"]))
                //初始化数据
                this.GetPageData(1);
                //this.Department = getDicData('14');
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //初始化部门下拉树
                getDepartmentData: function () {
                    var mythis = this;
                    myAjax("post", this, '/api/SysDepartment/GetList', { model: { Name: '', Code: '', CreateFactory: mythis.formInline.model.createFactory }, offset: 0, limit: 999 }, function (response) {
                        mythis.department = menuHelperX(response.data.pageData, guidEmpty)
                    }, false);
                },
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                closeDialog: function () { closeDialog(this); },
                //Model 替换成 表名
                onDelete: function () { onDelete(this, '/api/TrainingAchievements/DeleteMuti'); },

                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Model 替换成 表名
                UserInput: function (val, id) { DialogShow(this, val, "TrainingArchivesInputNew.html", id); },

                //Model 替换成 表名
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/PX_TrainingArchives/GetList') },

                onSubmit: function () { onSubmit(this); },

                handleSizeChange: function (val) { handleSizeChange(this, val); },

                handleCurrentChange: function (val) { handleCurrentChange(this, val); },

                handleNodeClick: function (data) {
                    this.formInline.model.Category = data.id;
                    this.GetPageData(1);
                }
            }
        });

        //下拉树数据格式化
        function menuHelperX(list, pid) {
            var result = [];
            if (list.length <= 0)
                return list;
            list.forEach(function (v, i) {
                var temp = {};
                for (var key in v) {
                    temp[key] = v[key];
                }
                temp.label = v.name;
                temp.parentId = temp.parentId ? temp.parentId : guidEmpty;
                var obj;
                if (temp.parentId == pid) {
                    obj = temp;
                    var nextObj = menuHelperX(list, temp.id);
                    if (nextObj.length > 0) {
                        obj.children = nextObj;
                    }
                }
                if (obj)
                    result.push(obj)
            })
            return result;
        }
    </script>

</body>

</html>